-
-
Notifications
You must be signed in to change notification settings - Fork 74
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow lockfile path to be configured #384
base: master
Are you sure you want to change the base?
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
I just started using autorestic and was looking for a way to control this. My reasoning is that I'm putting the config file in |
Also, it would be nice if we could set the lockfile path in the config file similar to the version: 2
global:
all:
cache-dir: /var/cache/restic
lockfile-dir: /run/lock/restic/
... |
I like the idea of specifying the lockfile through the config file. It makes a ton of sense to me. I don't think that we can fit this under the What do you think of adding this option at the root of the config. So it'd be something like this: version: 2
lockfile: /var/lock/restic/autorestic.lock.yaml
global:
all:
cache-dir: ...
... Note that in my example |
That's true. Making it a top-level configuration option makes sense then.
I was debating this myself in my example so I think this also makes sense. |
In a future commit, I'll need the lockfile code to access the config file. This solves an import cycle.
I've implemented the basic functionality of reading the lockfile path from the config. I still need to do some of the finishing touches: documentation and tests. |
fa27d04
to
de0862a
Compare
This is more consistent with the `lockfile` config option
I just finished up. The documentation and tests are now done. On top of this, I've changed the flag from |
The goal of this feature is to allow users to control the path of the lockfile. This is useful in situations where you don't want the lockfile to default next to the config file.
For my use case, I want to generate the config file with Nix which will store it in a read-only path. In such a situation
autorestic
won't be able to create the lockfile.This PR adds a few ways to let users control their lockfile path:
--lockfile
flaglockfile: ...
config optionNote that this PR includes a refactor that merges the
lock
package back into theinternal
package. This is done to avoid a circular dependency where thelock
package needs to read the config from theinternal
package but theinternal
package also needs to use thelock
package.